import {
  CoolController,
  BaseController,
  CoolCommException,
} from '@cool-midway/core';
import { Get, Inject, Query } from '@midwayjs/core';
import { MangoRequestService } from '../../../service/request';

/**
 * 获取影院相关接口
 */
@CoolController()
export class MangoAppOpenCinemaController extends BaseController {
  @Inject()
  mangoRequestService: MangoRequestService;
  /**
   * 获取影院列表
   */
  @Get('/list', { summary: '获取影院列表' })
  async getList(@Query() query) {
    const url = '/api/6216f72d04def';
    try {
      return this.ok(await this.mangoRequestService.post(url, query));
    } catch (error) {
      throw new CoolCommException(error.message);
    }
  }
  /**
   * 影片近期有排期的影院
   */
  @Get('/listByMovie', { summary: '影片近期有排期的影院' })
  async getListByMovie(@Query() query) {
    const url = '/api/622af9a878b0d';
    try {
      return this.ok(await this.mangoRequestService.post(url, query));
    } catch (error) {
      throw new CoolCommException(error.message);
    }
  }
  /**
   * 影院信息&影院排期的电影数据
   */
  @Get('/detail', { summary: '影院信息&影院排期的电影数据' })
  async detail(@Query() query) {
    const url = '/api/622b4ae2df618';
    try {
      return this.ok(await this.mangoRequestService.post(url, query));
    } catch (error) {
      throw new CoolCommException(error.message);
    }
  }
  /**
   * 影院的电影场次数据
   */
  @Get('/arrangement', { summary: '影院的电影场次数据' })
  async arrangement(@Query() query) {
    const url = '/api/622c07d7c7d8f';
    try {
      return this.ok(await this.mangoRequestService.post(url, query));
    } catch (error) {
      throw new CoolCommException(error.message);
    }
  }
  /**
   * 影院的电影场次座位数据
   */
  @Get('/seat', { summary: '影院的电影场次座位数据' })
  async seat(@Query() query) {
    const url = '/api/622c5b0915bee';
    try {
      return this.ok(await this.mangoRequestService.post(url, query));
    } catch (error) {
      throw new CoolCommException(error.message);
    }
  }
}
